/*    */ package com.zimbra.cs.dav.resource;
/*    */ 
/*    */ import com.zimbra.cs.dav.DavContext;
/*    */ import com.zimbra.cs.dav.DavException;
/*    */ import com.zimbra.cs.mailbox.MailItem.Type;
/*    */ import java.util.ArrayList;
/*    */ import java.util.EnumSet;
/*    */ import java.util.List;
/*    */ import java.util.Set;
/*    */ import java.util.StringTokenizer;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public abstract class PhantomResource
/*    */   extends DavResource
/*    */ {
/*    */   protected static final String BY_DATE = "by-date";
/*    */   protected static final String BY_TYPE = "by-type";
/*    */   protected static final String BY_SENDER = "by-sender";
/*    */   protected static final String TODAY = "today";
/*    */   protected static final String WEEK = "last-week";
/*    */   protected static final String MONTH = "last-month";
/*    */   protected static final String YEAR = "last-year";
/*    */   protected static final String ALL = "all";
/*    */   protected List<String> mTokens;
/*    */   protected long mNow;
/* 47 */   protected static final Set<MailItem.Type> SEARCH_TYPES = EnumSet.of(MailItem.Type.MESSAGE);
/*    */   
/*    */   PhantomResource(String uri, String owner, List<String> tokens) {
/* 50 */     super(uri, owner);
/* 51 */     this.mTokens = tokens;
/* 52 */     this.mNow = System.currentTimeMillis();
/* 53 */     setCreationDate(this.mNow);
/* 54 */     setLastModifiedDate(this.mNow);
/* 55 */     setProperty("getcontentlength", "0");
/* 56 */     setProperty("displayname", (String)tokens.get(tokens.size() - 1));
/*    */   }
/*    */   
/*    */   protected static List<String> parseUri(String uri) {
/* 60 */     ArrayList<String> l = new ArrayList();
/* 61 */     StringTokenizer tok = new StringTokenizer(uri, "/");
/* 62 */     while (tok.hasMoreTokens())
/* 63 */       l.add(tok.nextToken());
/* 64 */     return l;
/*    */   }
/*    */   
/*    */   public void delete(DavContext ctxt) throws DavException
/*    */   {
/* 69 */     throw new DavException("cannot delete this resource", 403, null);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/dav/resource/PhantomResource.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */